﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using STX.Domain;

namespace STX.Admin.Models.BizFinancial
{
    public class EditModel:BaseEditModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public decimal TotalQuotation { get; set; }
        public decimal IncreaseOrDecrease { get; set; }
        #region 发票

        /// <summary>
        /// 通知开票
        /// </summary>
        /// <value>The apply invoice man.</value>
        public string ApplyInvoiceMan { get; set; }

        /// <summary>
        /// 通知日期
        /// </summary>
        /// <value>The apply invoice date.</value>
        public DateTime ApplyInvoiceDate { get; set; }

        /// <summary>
        /// 开票日期
        /// </summary>
        /// <value>The make invoice date.</value>
        public DateTime MakeInvoiceDate { get; set; }

        /// <summary>
        /// 发票号码
        /// </summary>
        /// <value>The invoice no.</value>
        public string InvoiceNo { get; set; }

        /// <summary>
        /// Gets a value indicating whether this instance is made invoice.
        /// </summary>
        /// <value><c>true</c> if this instance is made invoice; otherwise, <c>false</c>.</value>
        public bool IsMadeInvoice
        {
            get { return !InvoiceNo.IsNullOrEmpty(); }
        }

        #endregion

        #region 回款
        /// <summary>
        /// 回款金额
        /// </summary>
        /// <value>The returned amount.</value>
        public decimal ReturnedAmount { get; set; }

        /// <summary>
        /// 回款日期
        /// </summary>
        /// <value>The returned date.</value>
        public DateTime ReturnedDate { get; set; }

        /// <summary>
        /// 是否回款
        /// </summary>
        /// <value><c>true</c> if this instance is returned; otherwise, <c>false</c>.</value>
        public bool IsReturned
        {
            get
            {
                return ReturnedAmount > 0;
            }
        }
        #endregion
    }
}